package com.support.sboard.dao;

import java.util.List;
import java.util.Map;

import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.stereotype.Component;

import com.support.sboard.domain.SboardCommand;



@Component
public class SboardDaoImpl extends SqlSessionDaoSupport implements SboardDao{

	@Override
	public List<SboardCommand> list(Map<String, Object> map) {
		List<SboardCommand> list = getSqlSession().selectList("Sboard.selectList",map);
		return list;
	}

	@Override
	public int getRowCount(Map<String, Object> map) {
		return getSqlSession().selectOne("Sboard.selectCount",map);
	}

	@Override
	public void insert(SboardCommand board) {
		getSqlSession().insert("Sboard.insertBoard",board);
	}

	@Override
	public SboardCommand selectBoard(Integer seq) {
		SboardCommand command = 
				(SboardCommand)getSqlSession().selectOne("Sboard.selectBoard",seq);
		return command;
	}

	

	@Override
	public void update(SboardCommand board) {
		getSqlSession().update("Sboard.updateBoard",board);
	}

	@Override
	public void delete(Integer seq) {
		getSqlSession().delete("Sboard.deleteBoard",seq);
	}

}
